/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package plugin;

import Main.Parameters;
import system.MessageOUTPUT;

/**
 *
 * @author ZeM
 */
public class PluginParalelThreadStart implements Runnable {

    public String PluginName; //name of plugin to run

    public void run() {
        int k = 0;
        boolean find_place_to_load = false;
        while (k < Parameters.LoadedPlugins.length & !find_place_to_load) {
            if (Parameters.LoadedPluginNames[k] == null) {
                Parameters.LoadedPluginNames[k]=PluginName;
                  String[] mes = {PluginName};
                new MessageOUTPUT().OUTPUT("ev0008",mes);
                Parameters.LoadedPlugins[k]= new PluginLoader();
                Parameters.LoadedPlugins[k].Load(PluginName);
                Parameters.LoadedPlugins[k].Start();
                find_place_to_load = true;
            } else {
                k++;
            }

        }
    }
}
